{% macro render_form(form, url) %}
<form method="POST" action="{{ url }}">
  {{ form.csrf_token }}
  {% for field in form %}
    {% if field.type == 'CSRFTokenField' %}
    {{ '' }}
    {% elif field.type == 'SubmitField' %}
    {{ form.submit(class='btn btn-primary', type='submit') }}
    {% elif field.type == 'BooleanField' %}
    <div class="checkbox">
      <label>{{ field() }} {{ field.label.text }}</label>
    </div>
    {% else %}
    <div class="form-group">
      {{ field.label }} {{ field(class='form-control') }}
    </div>
    {% endif %}
  {% endfor %}
</form>
{% endmacro %}
